package com.inmobi.re.container;

import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Paint;
import android.net.http.SslError;
import android.os.Build.VERSION;
import android.view.Display;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import com.inmobi.commons.internal.Log;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class WrapperFunctions
{
  private static final String FIELD_CONFIG_SCREEN_SIZE = "CONFIG_SCREEN_SIZE";
  private static final String FIELD_CONFIG_SMALLEST_SCREEN_SIZE = "CONFIG_SMALLEST_SCREEN_SIZE";
  private static final String FIELD_FILL_PARENT = "FILL_PARENT";
  private static final String FIELD_MATCH_PARENT = "MATCH_PARENT";
  private static final String FIELD_REVERSE_LANDSCAPE = "SCREEN_ORIENTATION_REVERSE_LANDSCAPE";
  private static final String FIELD_REVERSE_PORTRAIT = "SCREEN_ORIENTATION_REVERSE_PORTRAIT";
  private static final String METHOD_GETHEIGHT = "getHeight";
  private static final String METHOD_GETSIZE = "getSize";
  private static final String METHOD_GETWIDTH = "getWidth";
  private static final String METHOD_GET_SSL_URL = "getUrl";
  private static final String METHOD_SET_LAYERTYPE = "setLayerType";
  private static int a;

  private static void a(IMWebView paramIMWebView, int paramInt)
  {
    try
    {
      Class localClass = paramIMWebView.getClass();
      Class[] arrayOfClass = new Class[2];
      arrayOfClass[0] = Integer.TYPE;
      arrayOfClass[1] = Paint.class;
      Method localMethod = localClass.getMethod("setLayerType", arrayOfClass);
      Object[] arrayOfObject = new Object[2];
      arrayOfObject[0] = Integer.valueOf(paramInt);
      arrayOfObject[1] = null;
      localMethod.invoke(paramIMWebView, arrayOfObject);
      return;
    }
    catch (NoSuchMethodException localNoSuchMethodException)
    {
      Log.internal("IMRE_3.7.0", "Cannot set hardware accl", localNoSuchMethodException);
      return;
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
      Log.internal("IMRE_3.7.0", "Cannot set hardware accl", localIllegalArgumentException);
      return;
    }
    catch (IllegalAccessException localIllegalAccessException)
    {
      Log.internal("IMRE_3.7.0", "Cannot set hardware accl", localIllegalAccessException);
      return;
    }
    catch (InvocationTargetException localInvocationTargetException)
    {
      Log.internal("IMRE_3.7.0", "Cannot set hardware accl", localInvocationTargetException);
    }
  }

  public static void disableHardwareAccl(IMWebView paramIMWebView)
  {
    a(paramIMWebView, 1);
  }

  public static int getCurrentOrientationInFixedValues(Activity paramActivity)
  {
    switch (paramActivity.getResources().getConfiguration().orientation)
    {
    default:
    case 1:
      int j;
      do
      {
        do
          return 1;
        while (Build.VERSION.SDK_INT < 8);
        j = paramActivity.getWindowManager().getDefaultDisplay().getRotation();
      }
      while ((j != 1) && (j != 2));
      return 9;
    case 2:
    }
    if (Build.VERSION.SDK_INT < 8)
      return 0;
    int i = paramActivity.getWindowManager().getDefaultDisplay().getRotation();
    if ((i == 0) || (i == 1))
      return 0;
    return 8;
  }

  // ERROR //
  public static int getDisplayHeight(Display paramDisplay)
  {
    // Byte code:
    //   0: iconst_1
    //   1: anewarray 59	java/lang/Class
    //   4: dup
    //   5: iconst_0
    //   6: ldc 139
    //   8: aastore
    //   9: astore_1
    //   10: ldc 131
    //   12: ldc 29
    //   14: aload_1
    //   15: invokevirtual 71	java/lang/Class:getMethod	(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
    //   18: astore 14
    //   20: aload 14
    //   22: astore 5
    //   24: iconst_1
    //   25: istore 4
    //   27: iload 4
    //   29: ifeq +80 -> 109
    //   32: new 139	android/graphics/Point
    //   35: dup
    //   36: invokespecial 140	android/graphics/Point:<init>	()V
    //   39: astore 10
    //   41: aload 5
    //   43: aload_0
    //   44: iconst_1
    //   45: anewarray 4	java/lang/Object
    //   48: dup
    //   49: iconst_0
    //   50: aload 10
    //   52: aastore
    //   53: invokevirtual 81	java/lang/reflect/Method:invoke	(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    //   56: pop
    //   57: aload 10
    //   59: getfield 143	android/graphics/Point:y	I
    //   62: istore 12
    //   64: iload 12
    //   66: ireturn
    //   67: astore_2
    //   68: ldc 131
    //   70: ldc 26
    //   72: aconst_null
    //   73: checkcast 145	[Ljava/lang/Class;
    //   76: invokevirtual 71	java/lang/Class:getMethod	(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
    //   79: astore 13
    //   81: aload 13
    //   83: astore 5
    //   85: iconst_0
    //   86: istore 4
    //   88: goto -61 -> 27
    //   91: astore_3
    //   92: ldc 83
    //   94: ldc 147
    //   96: aload_3
    //   97: invokestatic 91	com/inmobi/commons/internal/Log:internal	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   100: iconst_0
    //   101: istore 4
    //   103: aconst_null
    //   104: astore 5
    //   106: goto -79 -> 27
    //   109: aload 5
    //   111: aload_0
    //   112: aconst_null
    //   113: checkcast 149	[Ljava/lang/Object;
    //   116: invokevirtual 81	java/lang/reflect/Method:invoke	(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    //   119: checkcast 61	java/lang/Integer
    //   122: invokevirtual 152	java/lang/Integer:intValue	()I
    //   125: istore 9
    //   127: iload 9
    //   129: ireturn
    //   130: astore 8
    //   132: ldc 83
    //   134: ldc 147
    //   136: aload 8
    //   138: invokestatic 91	com/inmobi/commons/internal/Log:internal	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   141: iconst_0
    //   142: ireturn
    //   143: astore 7
    //   145: ldc 83
    //   147: ldc 147
    //   149: aload 7
    //   151: invokestatic 91	com/inmobi/commons/internal/Log:internal	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   154: iconst_0
    //   155: ireturn
    //   156: astore 6
    //   158: ldc 83
    //   160: ldc 147
    //   162: aload 6
    //   164: invokestatic 91	com/inmobi/commons/internal/Log:internal	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   167: iconst_0
    //   168: ireturn
    //
    // Exception table:
    //   from	to	target	type
    //   10	20	67	java/lang/NoSuchMethodException
    //   68	81	91	java/lang/NoSuchMethodException
    //   32	64	130	java/lang/IllegalArgumentException
    //   109	127	130	java/lang/IllegalArgumentException
    //   32	64	143	java/lang/IllegalAccessException
    //   109	127	143	java/lang/IllegalAccessException
    //   32	64	156	java/lang/reflect/InvocationTargetException
    //   109	127	156	java/lang/reflect/InvocationTargetException
  }

  // ERROR //
  public static int getDisplayWidth(Display paramDisplay)
  {
    // Byte code:
    //   0: iconst_1
    //   1: anewarray 59	java/lang/Class
    //   4: dup
    //   5: iconst_0
    //   6: ldc 139
    //   8: aastore
    //   9: astore_1
    //   10: ldc 131
    //   12: ldc 29
    //   14: aload_1
    //   15: invokevirtual 71	java/lang/Class:getMethod	(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
    //   18: astore 14
    //   20: aload 14
    //   22: astore 5
    //   24: iconst_1
    //   25: istore 4
    //   27: iload 4
    //   29: ifeq +80 -> 109
    //   32: new 139	android/graphics/Point
    //   35: dup
    //   36: invokespecial 140	android/graphics/Point:<init>	()V
    //   39: astore 10
    //   41: aload 5
    //   43: aload_0
    //   44: iconst_1
    //   45: anewarray 4	java/lang/Object
    //   48: dup
    //   49: iconst_0
    //   50: aload 10
    //   52: aastore
    //   53: invokevirtual 81	java/lang/reflect/Method:invoke	(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    //   56: pop
    //   57: aload 10
    //   59: getfield 156	android/graphics/Point:x	I
    //   62: istore 12
    //   64: iload 12
    //   66: ireturn
    //   67: astore_2
    //   68: ldc 131
    //   70: ldc 32
    //   72: aconst_null
    //   73: checkcast 145	[Ljava/lang/Class;
    //   76: invokevirtual 71	java/lang/Class:getMethod	(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
    //   79: astore 13
    //   81: aload 13
    //   83: astore 5
    //   85: iconst_0
    //   86: istore 4
    //   88: goto -61 -> 27
    //   91: astore_3
    //   92: ldc 83
    //   94: ldc 158
    //   96: aload_3
    //   97: invokestatic 91	com/inmobi/commons/internal/Log:internal	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   100: iconst_0
    //   101: istore 4
    //   103: aconst_null
    //   104: astore 5
    //   106: goto -79 -> 27
    //   109: aload 5
    //   111: aload_0
    //   112: aconst_null
    //   113: checkcast 149	[Ljava/lang/Object;
    //   116: invokevirtual 81	java/lang/reflect/Method:invoke	(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    //   119: checkcast 61	java/lang/Integer
    //   122: invokevirtual 152	java/lang/Integer:intValue	()I
    //   125: istore 9
    //   127: iload 9
    //   129: ireturn
    //   130: astore 8
    //   132: ldc 83
    //   134: ldc 158
    //   136: aload 8
    //   138: invokestatic 91	com/inmobi/commons/internal/Log:internal	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   141: iconst_0
    //   142: ireturn
    //   143: astore 7
    //   145: ldc 83
    //   147: ldc 158
    //   149: aload 7
    //   151: invokestatic 91	com/inmobi/commons/internal/Log:internal	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   154: iconst_0
    //   155: ireturn
    //   156: astore 6
    //   158: ldc 83
    //   160: ldc 158
    //   162: aload 6
    //   164: invokestatic 91	com/inmobi/commons/internal/Log:internal	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   167: iconst_0
    //   168: ireturn
    //
    // Exception table:
    //   from	to	target	type
    //   10	20	67	java/lang/NoSuchMethodException
    //   68	81	91	java/lang/NoSuchMethodException
    //   32	64	130	java/lang/IllegalArgumentException
    //   109	127	130	java/lang/IllegalArgumentException
    //   32	64	143	java/lang/IllegalAccessException
    //   109	127	143	java/lang/IllegalAccessException
    //   32	64	156	java/lang/reflect/InvocationTargetException
    //   109	127	156	java/lang/reflect/InvocationTargetException
  }

  public static int getParamConfigScreenSize()
  {
    ActivityInfo localActivityInfo = new ActivityInfo();
    try
    {
      Field localField = ActivityInfo.class.getField("CONFIG_SCREEN_SIZE");
      int i = 0;
      if (localField != null)
      {
        int j = localField.getInt(localActivityInfo);
        i = j;
      }
      return i;
    }
    catch (NoSuchFieldException localNoSuchFieldException)
    {
      Log.internal("IMRE_3.7.0", "Cannot get screen size", localNoSuchFieldException);
      return 0;
    }
    catch (Exception localException)
    {
      Log.internal("IMRE_3.7.0", "Cannot get screen size", localException);
    }
    return 0;
  }

  public static int getParamConfigSmallestScreenSize()
  {
    ActivityInfo localActivityInfo = new ActivityInfo();
    try
    {
      Field localField = ActivityInfo.class.getField("CONFIG_SMALLEST_SCREEN_SIZE");
      int i = 0;
      if (localField != null)
      {
        int j = localField.getInt(localActivityInfo);
        i = j;
      }
      return i;
    }
    catch (NoSuchFieldException localNoSuchFieldException)
    {
      Log.internal("IMRE_3.7.0", "Cannot get smallest screen size", localNoSuchFieldException);
      return 0;
    }
    catch (Exception localException)
    {
      Log.internal("IMRE_3.7.0", "Cannot get smallest screen size", localException);
    }
    return 0;
  }

  public static int getParamFillParent()
  {
    if (a == 0);
    try
    {
      ViewGroup.LayoutParams localLayoutParams;
      if (a == 0)
        localLayoutParams = new ViewGroup.LayoutParams(1, 1);
      try
      {
        Field localField2 = ViewGroup.LayoutParams.class.getField("MATCH_PARENT");
        localObject2 = localField2;
        if (localObject2 == null);
      }
      catch (NoSuchFieldException localNoSuchFieldException1)
      {
        try
        {
          while (true)
          {
            Object localObject2;
            a = ((Field)localObject2).getInt(localLayoutParams);
            return a;
            localNoSuchFieldException1 = localNoSuchFieldException1;
            try
            {
              Field localField1 = ViewGroup.LayoutParams.class.getField("FILL_PARENT");
              localObject2 = localField1;
            }
            catch (NoSuchFieldException localNoSuchFieldException2)
            {
              Log.internal("IMRE_3.7.0", "Cannot get fill parent param", localNoSuchFieldException2);
              localObject2 = null;
            }
          }
        }
        catch (Exception localException)
        {
          while (true)
            Log.internal("IMRE_3.7.0", "Cannot get fill parent param", localException);
        }
      }
    }
    finally
    {
    }
  }

  public static int getParamLandscapeOrientation(int paramInt)
  {
    int i = 0;
    ActivityInfo localActivityInfo;
    if (paramInt == 3)
      localActivityInfo = new ActivityInfo();
    try
    {
      Field localField = ActivityInfo.class.getField("SCREEN_ORIENTATION_REVERSE_LANDSCAPE");
      i = 0;
      if (localField != null)
      {
        int j = localField.getInt(localActivityInfo);
        i = j;
      }
      return i;
    }
    catch (NoSuchFieldException localNoSuchFieldException)
    {
      Log.internal("IMRE_3.7.0", "Cannot get landscape orientation", localNoSuchFieldException);
      return 0;
    }
    catch (Exception localException)
    {
      Log.internal("IMRE_3.7.0", "Cannot get landscape orientation", localException);
    }
    return 0;
  }

  public static int getParamPortraitOrientation(int paramInt)
  {
    int i = 1;
    ActivityInfo localActivityInfo;
    if (paramInt == 2)
      localActivityInfo = new ActivityInfo();
    try
    {
      Field localField = ActivityInfo.class.getField("SCREEN_ORIENTATION_REVERSE_PORTRAIT");
      if (localField != null)
      {
        int j = localField.getInt(localActivityInfo);
        i = j;
      }
      return i;
    }
    catch (NoSuchFieldException localNoSuchFieldException)
    {
      Log.internal("IMRE_3.7.0", "Cannot get portrait orientation", localNoSuchFieldException);
      return i;
    }
    catch (Exception localException)
    {
      Log.internal("IMRE_3.7.0", "Cannot get portrait orientation", localException);
    }
    return i;
  }

  public static String getSSLErrorUrl(SslError paramSslError)
  {
    try
    {
      String str = Class.forName("android.net.http.SslError").getDeclaredMethod("getUrl", new Class[0]).invoke(paramSslError, new Object[0]).toString();
      return str;
    }
    catch (Exception localException)
    {
      Log.internal("IMRE_3.7.0", "Cannot get SSL Url", localException);
    }
    return null;
  }

  public static Bitmap getVideoBitmap(String paramString)
    throws Exception
  {
    try
    {
      Class localClass = Class.forName("android.media.ThumbnailUtils");
      Class[] arrayOfClass = new Class[2];
      arrayOfClass[0] = String.class;
      arrayOfClass[1] = Integer.TYPE;
      Method localMethod = localClass.getDeclaredMethod("createVideoThumbnail", arrayOfClass);
      Object[] arrayOfObject = new Object[2];
      arrayOfObject[0] = paramString;
      arrayOfObject[1] = Integer.valueOf(1);
      Bitmap localBitmap = (Bitmap)localMethod.invoke(null, arrayOfObject);
      return localBitmap;
    }
    catch (Exception localException)
    {
      Log.internal("IMRE_3.7.0", "Cannot get video bitmap", localException);
      throw localException;
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.inmobi.re.container.WrapperFunctions
 * JD-Core Version:    0.6.2
 */